#include <iostream>

using std::cout;
using std::endl;

class Point
{

private:
    int _ix;//4
    int _iy;//4
};

//64位系统默认情况下按8字节对齐
class Point2
{
private:
    int _ix;//4
    double _dy;//8
};

class Point3
{
private:
    double _dy;//8
    int _ix;//4
};

class Point4
{
private:
    int _ix;//4
    double _dy;//8
    int _iy;//4
};

int main()
{
    cout << "sizeof(Point):" << sizeof(Point) << endl;
    cout << "sizeof(Point2):" << sizeof(Point2) << endl;
    cout << "sizeof(Point3):" << sizeof(Point3) << endl;
    cout << "sizeof(Point4):" << sizeof(Point4) << endl;

    return 0;
}

